<template>
  <view class="mvBox">
    <video class="video" :src="mvUrl" autoplay loop></video>
  </view>
</template>

<script>
export default {
  data() {
    return {
      item: "",
      mvUrl: "",
    };
  },
  onLoad(option) {
    this.item = JSON.parse(decodeURIComponent(option.item));
    this.getMvUrl(this.item.id);
  },
  methods: {
    // 获取视频播放地址
    getMvUrl(id) {
      this.request("/mv/url", "GET", { id }).then((res) => {
        this.mvUrl = res.data.url;
      });
    },
  },
};
</script>

<style lang="less">
.mvBox {
  width: 750rpx;
  .video {
    width: 750rpx;
    height: 100vh;
  }
}
</style>